package com.my.myTradeData;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.codahale.metrics.annotation.Timed;
import com.google.common.base.Optional;

@Path("/hello-world")
@Produces(MediaType.APPLICATION_JSON)
public class MyResource {
	private final String template;
	private final String defaultName;
	private final AtomicLong counter;

	public MyResource(String template, String defaultName) {
		this.template = template;
		this.defaultName = defaultName;
		this.counter = new AtomicLong();
	}

	@GET
	@Timed
	public List<Double> sayHello(@QueryParam("name") Optional<String> name) {
		List<Double> list = HibernateUtil.selectAllData();
		return list;
	}
}
